home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6878 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: winternet.com!mschwarz
  2. From: mschwarz@winternet.com (Michael Schwarz)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Watch out!  C "gotcha!"
  5. Date: 15 Feb 1996 22:56:06 GMT
  6. Organization: StarNet Communications, Inc
  7. Message-ID: <4g0dm6$97v@blackice.winternet.com>
  8. References: <4fthhh$7th@blackice.winternet.com>
  9. NNTP-Posting-Host: parka.winternet.com
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12.  
  13. I just want to leap back into the thread I started and clarify something.
  14.  
  15. I've been getting a lot of mail from folks telling me this is not a bug.
  16. I *know* it's not a bug.  That's why I called it a "gotcha."  We all know
  17. a bunch of these in C (like the common "=" vs. "==" mistake).  It's
  18. just that in all the years I've been programming in C this particular
  19. "gotcha" had never occured to me.  I've never written a C program with
  20. a goto in my life (until fiddling around with this little phenomenon)
  21. and so the (obvious in retrospect) recognition that "default" misspelled
  22. is a label simply took a while to occur to me.
  23.  
  24. The reason I posted it was realizing that this error had been sitting
  25. a piece of production code for an unknown period of time gave me the
  26. willies (apologies to UK readers!).  I suspect that a fairly substantial
  27. number of working C programmers were and are likewise ignorant of this
  28. insidious little nascent error.  I was likewise bothered by the fact
  29. that of the five C compilers I routinely use, only ONE (MS Visual C/C++)
  30. gives a warning for this (to wit, "unreferenced label"), and two of them
  31. cannot be made to produce a warning for this.
  32.  
  33. I thought it might be a bit of a civilized act to draw attention to it.
  34. (BTW, I'm not coming down on any of the folks who have sent me e-mail on
  35. this -- you've all been helpful and fun.  Thank you to all of you!)
  36.  
  37.  
  38. --
  39. Michael A. Schwarz                           Minneapolis, MN
  40. mschwarz@winternet.com                  n0zes@n0zes.ampr.org
  41.  
  42.